package top.v5it.japi.ddd.example.order.proxy;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import top.v5it.japi.ddd.example.order.configuration.FeignConfiguration;
import top.v5it.japi.ddd.example.domain.proxy.ProductVO;
import top.v5it.japi.ddd.example.order.proxy.impl.ProductServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @author zhanpu
 * @date 2023/11/16
 */
@FeignClient(name = "example-product", fallback = ProductServiceImpl.class, configuration = FeignConfiguration.class)
public interface ProductService {

    @GetMapping("/orm/product/get_product?id={id}")
    ProductVO getProduct(@PathVariable("id") Long id);

    @GetMapping("/orm/product/get_products")
    List<ProductVO> getProducts(@RequestBody Map<String, List<Long>> ids);

}
